<template>
    <div>
         <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="(value,i) in newslist" :key="i">
                    <router-link :to="'/home/newsinfo?sid='+value.sid">
						<img class="mui-media-object mui-pull-left" :src="value
                        .url">
						<div class="mui-media-body">
							<h2>{{value.title}}</h2>
							<p class='mui-ellipsis'>
                                <span>发表时间:{{value.datetime | dateFormat("YYYY-MM-DD")}}</span>
                                <span>点击:{{value.click}}次</span>
                            </p>
				    	</div>
                    </router-link>
				</li>
			</ul>
    </div>
</template>
<script>
export default {
    data() {
        return {
            newslist:[]
        }
    },
    methods: {
        getNewslist(){
            // console.log(this)
            this.axios({
                url:"http://10.31.162.198/1810-3/Vue/vue-cms/src/lib/PHP/newslist.php"
            }).then(res=>{
                this.newslist=res.data;
                // console.log( this.newslist)
            })
        }
    },
    created(){
        this.getNewslist()
    }
}
</script>
<style lang="scss" scoped>
    .mui-table-view{
        // margin-bottom: 50px;
        li{
            .ak{
                width: 100%;
                height: 100%;
            }
            h2{
                font-size: 14px
            }
            .mui-ellipsis{
                font-size: 12px;
                color: chocolate;
                span{
                    &:nth-child(2){
                        float: right;
                    }
                }
            }
        }
    }
</style>